import { queryUserInfo } from 'api';
  
  export default {
      namespace: 'login',
    
      state: {
        UserInfoResource: {},
      },
    
      effects: {
        *queryUserInfo({ payload }, { call, put }) {
          const data = yield call(queryUserInfo, payload)
          const { success, message, status, ...other } = data
          if (success) {
            return other
          } else {
            throw data
          }
        },
      },
    
      reducers: {
        setState(state, action) {
          return {
              ...state,
              ...action.payload
          };
        }
      },
    }
    